import PageHeaderWrapper from '@/components/PageHeaderWrapper';
import PageLoading from '@/components/PageLoading';
import download from '@/utils/download';
import { Button, Card, Form, Input, Modal, Row, Spin, Tabs, Tooltip, Icon } from 'antd';
import { connect } from 'dva';
import moment from 'moment';
import Bottword from '@/modules/Bottword.js';
import React, { Component, Suspense } from 'react';
import { FormattedMessage } from 'umi-plugin-react/locale';
import styles from './index.less';
import AmendantRecord from './Versiona.js';
import RecycleBin from './Versionb.js'; //

const { TabPane } = Tabs;
const FormItem = Form.Item;

class VersionMaintenance extends Component {
  constructor(props) {
    super(props);
    this.state = {
      size: '1',
    };
  }

  componentDidMount() {}

  callback = key => {
    console.log(key);
  };

  butta = () => {
    // console.log(val)
    this.setState({ size: '1' });
  };

  buttb = () => {
    // console.log(val)
    this.setState({ size: '2' });
  };

  render() {
    const { getFieldDecorator } = this.props.form;
    const { size } = this.state
    const a = {
      color: '#fff',
      background: '-webkit-linear-gradient(left, #0E73FF , #09ACFA)',
    };
    const b = {
      color: '#fff',
      background: '-webkit-linear-gradient(right, #0E73FF , #09ACFA)',
    };
    return (
      <div className={styles.abc}>
         <div style={{height:9}}></div>
        {/* <div  className={styles.backgroundp}> */}
        <p style={{marginLeft:20}} className="pageTitle">版本维护</p>
        <div style={{marginLeft:20}} className={styles.flexcen1}>
          <div style={size === '1' ? b : null} onClick={this.butta} className={styles.butta}>
            修改记录
          </div>
          <div style={size === '2' ? a : null} onClick={this.buttb} className={styles.buttb}>
            回收站
          </div>
        </div>
        <div >
           {size === '1' ? <AmendantRecord totalAHome={this.totalAHome} /> : null}
          {size === '2' ? <RecycleBin  totalBHome={this.totalBHome} /> : null}
        </div>
      </div>
    );
  }
}
export default connect(({ user }) => ({
  // 全局数据
  currentUser: user.currentUser,
}))(Form.create()(VersionMaintenance));
